<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.org/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="/resources/layui/css/layui.css">
</head>
<body>
<script src="/resources/layui/layui.js"></script>
<script type="text/javascript" src="/resources/js/jquery-1.12.3.min.js"></script>

<script th:inline="none">
    //一般直接写在一个js文件中
    layui.use(['layer', 'form','table'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,table = layui.table
            ,$=layui.jquery;
        var id=$("#vehiddtl").val();
        //根据父页面传来的id获取车辆信息并回填
        $.ajax({
            type:"get",
            url:"/vehiclefiles/selecctVehicleById",
            data:{vehid:id},
            traditional:true,
            success:function(resp){
                console.log(resp.data.vehiclefile);
                var vehiclefile=resp.data.vehiclefile;
                $("#vehiclenum").html(vehiclefile.vehiclenum);
                $("#brandid").html(vehiclefile.brand.name);
                $("#clazzid").html(vehiclefile.clazz.name);
                $("#typeid").html(vehiclefile.type.name);
                $("#colorid").html(vehiclefile.color.name);
                $("#seat").html(vehiclefile.seat);
                $("#did").html(vehiclefile.dept.name);
                $("#purchasedate").html(vehiclefile.purchasedate);
                $("#statusid").html(vehiclefile.status.name);
                $("#available").html(vehiclefile.available);
            }
        });
    });
</script>

<form class="layui-form" action="" id="formUpdate">
    <input type="hidden" id="vehiddtl" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">车牌号：</label>
        <div class="layui-input-block">
            <span id="vehiclenum" style="margin-top: 10px"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">品牌：</label>
        <div class="layui-input-block">
            <span id="brandid"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">级别：</label>
        <div class="layui-input-block">
            <span id="clazzid"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">型号：</label>
        <div class="layui-input-block">
            <span id="typeid"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">颜色：</label>
        <div class="layui-input-block">
            <span id="colorid"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">座位数：</label>
        <div class="layui-input-block">
            <span id="seat"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">部门：</label>
        <div class="layui-input-block">
            <span id="did"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">购买日期：</label>
        <div class="layui-input-inline">
            <span id="purchasedate"></span>
        </div>

    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">车辆状态：</label>
        <div class="layui-input-block">
            <span id="statusid"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-block">
            <span id="available"></span>
        </div>
    </div>
</form>

</body>
</html>